home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cc02.arc
/
CRYPT.C
< prev
next >
Wrap
Text File
|
1986-03-14
|
624b
|
28 lines
/* crypt.c by Michael Hanson */
/* you may use this, but not for profit, and give me credit */
/* encryption program, decryption program */
#include "stdio.h"
#include "errs.c"
#include "version.c"
#include "filp.c"
main(argc,argv)
int argc;
char *argv[];
{
int c,i,keylen;
if(ver() < 0x200){
error("wrong DOS version",1);
#asm
db 'by Michael Hanson v1.0',1ah
#
}
if ((argc > 1) && ((keylen = strlen(argv[1])) > 0))
for (i=0; (c=getc(STDIN)) != EOF; i =(++i % keylen))
putc((char)((char)c ^ (argv[1])[i]),STDOUT);
/* xor c key[i] */
else
error("usage: crypt key.",1);
}